const { json } = require('express');
const user = require('../data/user');
module.exports = async (req, res, next) => {
  const tel = req.query.userTel
  console.log(tel)
  const data = await user.find({ tel: tel }, { _id: 0, __v: 0 });

  if (data.length > 0) {
    
    const d = data[0].shopCart ? JSON.parse(data[0].shopCart) : []
    console.log(d)
    res.send({
      code: 1,
      msg: "获取成功",
      data: d,
      userMsg:data
    })


  }



}